package org.dashboard.service;

import com.github.pagehelper.PageInfo;
import org.dashboard.bean.AdDatasource;
import org.dashboard.bean.AdRole;
import org.dashboard.bean.AdUser;
import org.dashboard.constant.DbSourceTypeEnum;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Properties;

public interface AdDatasourceService {
    int deleteByPrimaryKey(Integer datasourceId);

    int insert(AdDatasource record);

    int insertSelective(AdDatasource record);

    AdDatasource selectByPrimaryKey(Integer datasourceId);

    int updateByPrimaryKeySelective(AdDatasource record);

    int updateByPrimaryKey(AdDatasource record);


    List<AdDatasource> selectAdDatasources();

    List<Object[]> getMetaTableNames(AdDatasource adDatasource);

    List<Object[]> getMetaColumnNames(AdDatasource adDatasource);

    Boolean datasourceTest(AdDatasource adDatasource);

    List<Map<String, Object>> getDataMapExecuteSql(String sqlStr, String sqlParams, AdDatasource adDatasource, AdUser user, List<AdRole> roles);

    List<Map<String, Object>> getDataMapInvokeService(String urlService, String urlFunction, String urlParams, AdUser user, List<AdRole> roles);

    PageInfo selectAdDatasourcesPaged(String criteria, Integer pageNum, Integer pageSize);

    boolean deleteByPrimaryKeys(ArrayList<Integer> datasourceIds);

}
